//
//  GDRegisterController.m
//  爱新奇－味道
//
//  Created by 热带雨林 on 17/2/25.
//  Copyright © 2017年 热带雨林. All rights reserved.
//

#import "GDRegisterController.h"
#import "GDHomeViewController.h"

@interface GDRegisterController ()
@property (weak, nonatomic) IBOutlet UITextField *nameLabel;
@property (weak, nonatomic) IBOutlet UITextField *passWordlabel;

@end

@implementation GDRegisterController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)loginClick:(UIButton *)sender {
    
    NSString *userName = self.nameLabel.text;
    NSString *passWord = self.passWordlabel.text;
    if([userName isEqualToString:@"RJXY"] && [passWord isEqualToString:@"123456"]){
        [self showHome];
    }else{
        UIAlertView *alterView = [[UIAlertView alloc]initWithTitle:@"错误信息" message:@"账户:RJXY 密码:123456" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
        [alterView show];
    }
}

- (void)showHome{
    GDHomeViewController *homeVC = [[GDHomeViewController alloc]init];
    homeVC.modalPresentationStyle = UIModalPresentationCustom;
    [self presentViewController:homeVC animated:YES completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
